[SEMVER-MAJOR] Remove "loopback.autoAttach()" - #1989
Conversation
fed3c2d to
9e940ac
Compare
There was a problem hiding this comment.
I think we should assert or throw... How would the app function with this setting?
There was a problem hiding this comment.
The setting will be ignored. If there are any models depending on autoAttach, then these models will return an error whenever a DAO method is invoked, something like "The model is not attached to any datasource".
On the second thought, I agree with you it's better to throw an error here, so that the problem is detected as soon as possible (at startup). Will rework.
|
Made a few comments. LGTM either way. Feel free to merge as is. |
|
Uff, this change is much more tricky than I initially thought. The unit-tests are depending on |
3ed3af0 to
da3991f
Compare
|
I have cleaned up the tests in 2fad45c and ff75613. Along the way, I discovered two issues:
@ritch could you please review again? |
|
@ritch Also my intention is to back-port all commits except the last one (Remove "loopback.autoAttach()") to 2.x, as they are backwards-compatible. Any objections? |
|
LGTM |
|
LGTM as well.
Go for it 👍 |
|
@slnode test please |
Rework User tests to not depend on `app.autoAttach()` and global shared registry of Models. Instead, each tests creates a fresh app instance with a new in-memory datasource and a new set of Models.
Rework tests in `test/rest.middleware.test.js` to not depend on `app.autoAttach()` and global shared registry of Models. Instead, each tests creates a fresh app instance with a new in-memory datasource and a new set of Models.
The method was deprecated since LoopBack 2.0, there is no need to keep it around in 3.0.
957db84 to
9b39a59
Compare
|
@slnode test please |
this option has been deprecated since 2.x tests already explicitly attach to datasources autoattach was removed in strongloop/loopback/pull/1989
this option has been deprecated since 2.x tests already explicitly attach to datasources autoattach was removed in strongloop/loopback#1989
The method was deprecated since LoopBack 2.0, there is no need to keep it around in 3.0.
Close #294
/to @ritch please review